<!DOCTYPE html>
<html lang="en">
<head>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>
    <meta charset="UTF-8">
    <title>立刻注册</title>
</head>
<body>
<div class="container">
    {% if regis_state == "input-none" %}
    <p>用户名或密码不能为空，请重新输入</p>
    {% elif regis_state == "user-exist" %}
    <p>用户名已存在，请尝试其他用户名</p>
    {% endif %}

  <form action="/register" method="post">
  <div class="mb-3">
    <label for="Username" class="form-label">用户名</label>
    <input type="text" class="form-control" id="Username" name="username">
  </div>
  <div class="mb-3">
    <label for="Password" class="form-label">密码</label>
    <input type="password" class="form-control" id="Password" name="password">
  </div>
  <button type="submit" class="btn btn-primary btn-sm">注册</button>

</form>
    <br>
    <h4><a href="{{ url_for('login') }}" class="btn btn-primary">返回登录</a></h4>
</div>
</body>
</html>

<!--<!DOCTYPE html>-->
<!--<html lang="en">-->
<!--<head>-->
<!--    <meta charset="UTF-8">-->
<!--    <meta name="viewport" content="width=device-width, initial-scale=1.0">-->
<!--    <title>User Registration</title>-->
<!--</head>-->
<!--<body>-->
<!--    <h1>User Registration</h1>-->
<!--    <div>-->
<!--        <label for="username">Username:</label>-->
<!--        <input type="text" id="username">-->
<!--    </div>-->
<!--    <div>-->
<!--        <label for="password">Password:</label>-->
<!--        <input type="password" id="password">-->
<!--    </div>-->
<!--    <button onclick="registerUser()">Register</button>-->

<!--    <script>-->
<!--        function registerUser() {-->
<!--            var username = document.getElementById('username').value;-->
<!--            var password = document.getElementById('password').value;-->

<!--            var data = {-->
<!--                username: username,-->
<!--                password: password-->
<!--            };-->

<!--            fetch('http://localhost:5000/register', {-->
<!--                method: 'POST',-->
<!--                headers: {-->
<!--                    'Content-Type': 'application/json'-->
<!--                },-->
<!--                body: JSON.stringify(data)-->
<!--            })-->
<!--            .then(response => response.json())-->
<!--            .then(data => {-->
<!--                alert(data.message);-->
<!--            })-->
<!--            .catch(error => {-->
<!--                console.error('Error:', error);-->
<!--            });-->
<!--        }-->
<!--    </script>-->
<!--</body>-->
<!--</html>-->
